package com.cm.projectx.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

/**
 * CREATE TABLE `price_task`  (
 *   `id` int NOT NULL,
 *   `task_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
 *   `task_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
 *   `schedule_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
 *   `week_day` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
 *   `day` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
 *   `product_monitor_relations` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL,
 *   `creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
 *   `create_time` datetime NULL DEFAULT NULL,
 *   `update_time` datetime NULL DEFAULT NULL,
 *   `expire_time` datetime NULL DEFAULT NULL,
 *   `report_end_time` datetime NULL DEFAULT NULL,
 *   `status` int NULL DEFAULT 1,
 *   PRIMARY KEY (`id`) USING BTREE
 * ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
 */
@TableName("price_task")
@Data
public class PriceTask {
    @TableId
    private Integer id;
    //任务编码
    @TableField("task_code")
    private String taskCode;
    //任务名称
    @TableField("task_name")
    private String taskName;

    @TableField("task_type")
    private String taskType;

    //任务报送周期   单次、周报、旬报、月报
    @TableField("schedule_type")
    private String scheduleType;
    //如果是周报  需填写每周的周几   1-7对应周日至周六
    @TableField("week_day")
    private String weekDay;
    //如果是月报  需要填哪天   支持到1-28
    @TableField("day")
    private String day;
    //旬
    @TableField("ten_day")
    private String tenDay;
    //自定义cron表达式
    @TableField("customize_cron")
    private String customizeCron;
    //自定义对应提前天数（1，2，3，4，5）
    @TableField("advance_days")
    private String advanceDays;
    //所属地区
    @TableField("area")
    private String area;

    //报价开始日期（如果为周期任务此值传入任务下发时间）
    @TableField("start_time")
    private String startTime;
    //报价结束日期
    @TableField("end_time")
    private String endTime;

    //任务发起时常(周期任务时取)
    @TableField("task_time")
    private String taskTime;

    //定时任务(任务开始时间)
    @TableField("schedule_task_start_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date scheduleTaskStartTime;

    //任务结束时间
    @TableField("schedule_task_end_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date scheduleTaskEndTime;

    //任务描述
    @TableField("task_remark")
    private String taskRemark;

    /**
     * 价格类型（三期采集指标）
     */
    private String priceType;

    /**
     * 保存任务和模板关联关系（模板code）
     */
    private String dkTemplateTypesCode;

    /**
     * 任务下发级别
     */
    @TableField("task_level")
    private String taskLevel;

    //存储了任务的子表信息， 包含商品和各监测点的选择关系
    @TableField("product_monitor_relations")
    private String productMonitorRelations;
    //创建人  前端把当前登录用户id直接传
    @TableField("creator")
    private String creator;
    @TableField("user_name")
    private String userName;
    @TableField("create_time")
    private Date createTime;
    @TableField("update_time")
    private Date updateTime;
    @TableField("expire_time")
    private Date expireTime;
    @TableField("report_end_time")
    private Date reportEndTime;
    @TableField("status")
    private Integer status;

    @TableField(exist = false)
    private boolean IsOnlyOne;
}
